﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Weazel.Willows.Model
{
	public interface IQueueConnector : IConnector 
	{
		
	}

	//public interface ISignalConnector : IConnector
	//{
	//}

	public interface IConnectorReader : IConnector 
	{ 
	}

	public interface IConnectorWriter : IConnector 
	{ 
	}

	public interface IQueueConnectorReader  : IQueueConnector
	{
		Module GetWritingDatapath();

		void BindReader(IQueueReaderInterface reader);
		void UnbindReader(IQueueReaderInterface reader);

		string CanReadSignalName { get; }
		string DequeueSignalName { get; }
		string DoReadSignalName { get; }
	}

	//public interface ISignalConnectorReader : ISignalConnector
	//{
	//  void BindReader(ISignalReaderInterface reader);
	//  void UnbindReader(ISignalReaderInterface reader);
	//}

	public interface IQueueConnectorWriter : IQueueConnector
	{
		List<Module> GetReadingDatapaths();

		void BindWriter(IQueueWriterInterface writer);
		void UnbindWriter(IQueueWriterInterface writer);
	
		string CanWriteSignalName { get; }		
		string EnqueueSignalName { get; }
		string DoWriteSignalName { get; }
	}

	//public interface ISignalConnectorWriter : ISignalConnector
	//{
	//  void BindWriter(ISignalWriterInterface writer);
	//  void UnbindWriter(ISignalWriterInterface writer);
	//}

	public interface IQueueReaderInterface
	{
		string Name				{ get; }
		string LocalName	{ get; }

		void Refine(RefinedModel.Model model);

		List<Module> GetReadingDatapaths();

		IQueueConnectorReader AttachedQueue { get; set; }

		void WriteChannelHierarchy(System.CodeDom.Compiler.IndentedTextWriter writer);
	}

	//public interface ISignalReaderInterface
	//{
	//  string LocalName { get; }

	//  void Refine(RefinedModel.Model model);
	//}

	public interface IQueueWriterInterface
	{
		string Name { get; }
		string LocalName { get;  }

		void BindWriter(IQueueWriterInterface writer);

		void Refine(RefinedModel.Model model);

		Module GetWritingDatapath();

		IQueueConnectorWriter AttachedQueue { get; set; }

		void WriteChannelHierarchy(System.CodeDom.Compiler.IndentedTextWriter writer);
	}

	//public interface ISignalWriterInterface
	//{
	//  void Refine(RefinedModel.Model model);
	//}

	public interface ISignal 
	{
		string LocalName { get; }
		void Refine(Weazel.Willows.RefinedModel.Model model);
	}
}		
